package com.hsgene.discount.service.api;

import com.hsgene.common.util.result.ApiResult;
import com.hsgene.dict.dto.SysDictDto;
import com.hsgene.discount.service.api.impl.DictServiceImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @desc:字典
 * @author: fuxiang
 * @date: 2018/9/25 15:31
 */
@FeignClient(value = "ms-mod-dict", path = "/v1.0/genetic/testing/dict", fallback = DictServiceImpl.class)
public interface DictService {
    /**
     * 根据字典id获取字典
     *
     * @param id
     * @return
     */
    @GetMapping("{id}")
    ApiResult<SysDictDto> getDictById(@PathVariable("id") String id);

    /**
     * 根据字典type获取字典
     *
     * @param type
     * @return
     */
    @GetMapping("type")
    ApiResult<List<SysDictDto>> getDictByType(@RequestParam("type") String type);

    /**
     * 根据字典id获取字典
     *
     * @param ids
     * @return
     */
    @GetMapping("dictList")
    ApiResult<List<SysDictDto>> getDictByIds(@RequestParam("ids[]") String[] ids);
}
